package jhunter.dao;

import java.util.List;

import jhunter.dao.bo.BaseObject;
import jhunter.dao.condition.Condition;
import jhunter.dao.condition.ExampleCondition;
import jhunter.dao.condition.NullPropertyCondition;
import jhunter.dao.condition.PropertyCondition;
import jhunter.dao.page.Page;
import jhunter.dao.select.Order;

public interface DataAccess {

	BaseObject findById(Long id) ;
	
	void insert(BaseObject bo);

	void delete(Long id);

	void delete(Condition condition);

	void update(BaseObject value, Long id);

	void update(BaseObject value, Condition condition);

	void updateIgnoreNull(BaseObject value, Condition condition);

	void updateIgnoreNull(BaseObject value, Long id);

	int count(Condition condition);

	List<BaseObject> query(Condition condition, Order... orders);

	Page<BaseObject> query(Page<BaseObject> page, Condition condition);
	
	PropertyCondition getPropertyCondition(String pName, String op, Object value);
	
	NullPropertyCondition getNullPropertyCondition(String pName);
	
	ExampleCondition createExample(BaseObject example);
	
	ExampleCondition createOrExample(BaseObject example);
	
	EntityExt getEntity();
}
